package com.pzh.logistics.service.impl;

import com.pzh.logistics.mbg.mapper.CollectionMapper;
import com.pzh.logistics.mbg.model.Collection;
import com.pzh.logistics.service.CollectionService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

@Service
public class CollectionServiceImpl implements CollectionService {

    @Resource
    private CollectionMapper collectionMapper;

    @Override
    @Transactional
    public int insert(Collection collection) {
        return collectionMapper.insert(collection);
    }

    @Override
    @Transactional
    public int updateState(Integer orderId, Integer state) {
        return collectionMapper.updateIsCollectionByOrderId(orderId, state);
    }
}
